/**
 * This is my code.
 *
 * $Id$
 */
package fi.jab.esb.config.xml.impl;

import fi.jab.esb.config.xml.HibernateBusType;
import fi.jab.esb.config.xml.HibernateMessageFilterType;
import fi.jab.esb.config.xml.XmlPackage;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Hibernate Bus Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link fi.jab.esb.config.xml.impl.HibernateBusTypeImpl#getHibernateMessageFilter <em>Hibernate Message Filter</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class HibernateBusTypeImpl extends BusImpl implements HibernateBusType
{
  /**
   * The cached value of the '{@link #getHibernateMessageFilter() <em>Hibernate Message Filter</em>}' containment reference list.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getHibernateMessageFilter()
   * @generated
   * @ordered
   */
  protected EList<HibernateMessageFilterType> hibernateMessageFilter;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected HibernateBusTypeImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return XmlPackage.Literals.HIBERNATE_BUS_TYPE;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EList<HibernateMessageFilterType> getHibernateMessageFilter()
  {
    if (hibernateMessageFilter == null)
    {
      hibernateMessageFilter = new EObjectContainmentEList<HibernateMessageFilterType>(HibernateMessageFilterType.class, this, XmlPackage.HIBERNATE_BUS_TYPE__HIBERNATE_MESSAGE_FILTER);
    }
    return hibernateMessageFilter;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
  {
    switch (featureID)
    {
      case XmlPackage.HIBERNATE_BUS_TYPE__HIBERNATE_MESSAGE_FILTER:
        return ((InternalEList<?>)getHibernateMessageFilter()).basicRemove(otherEnd, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case XmlPackage.HIBERNATE_BUS_TYPE__HIBERNATE_MESSAGE_FILTER:
        return getHibernateMessageFilter();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @SuppressWarnings("unchecked")
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case XmlPackage.HIBERNATE_BUS_TYPE__HIBERNATE_MESSAGE_FILTER:
        getHibernateMessageFilter().clear();
        getHibernateMessageFilter().addAll((Collection<? extends HibernateMessageFilterType>)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case XmlPackage.HIBERNATE_BUS_TYPE__HIBERNATE_MESSAGE_FILTER:
        getHibernateMessageFilter().clear();
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case XmlPackage.HIBERNATE_BUS_TYPE__HIBERNATE_MESSAGE_FILTER:
        return hibernateMessageFilter != null && !hibernateMessageFilter.isEmpty();
    }
    return super.eIsSet(featureID);
  }

} //HibernateBusTypeImpl
